import java.util.*;

public class Main{
    public static void main(String[] args0){
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            String s = sc.nextLine();
            solve(s);
        }
        sc.close();
    }
    public static void solve(String line){
        String[] a = line.replaceAll("[^a-zA-Z]+", " ").trim().split("\\s+");
        for(int i=a.length-1; i>0;i--){
            System.out.print(a[i]);
            System.out.print(" ");
        }
        System.out.println(a[0]);
    }
}